package com.kingyun.gpsinspection.purificationservice.facade.model.som;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

/**
 * 数据返回对象.
 * Created by yangcs on 2017/1/9.
 */
public class ResultObj implements Serializable {
    /**
     * 反馈状态.
     */
    private int status;

    /**
     * 反馈信息.
     */
    private String msg;

    /**
     * 反馈数据.
     */
    private Object data;

    public ResultObj() {}

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public ResultObj(int status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    /**
     * 转换成json格式字符串
     * @return
     */
    public JSONObject toJson() {
        JSONObject object = new JSONObject();
        object.put("data",data);
        object.put("msg",msg);
        object.put("status",status);
        return object;
    }

}
